<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.cnbisoft.utils.tools.properties.*"%>
<%@ page import="com.cnbisoft.utils.bean.*"%>
<%@ page import="java.io.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
    
	PropertyReader bean = new PropertyReader();
    String filePath = this.getServletContext().getRealPath(File.separator)+"dashboard"+File.separator+"forcecast"+File.separator+"assets"+File.separator+"index.properties";
    bean.setUrl(filePath);
    List<Map<String,UtilBean>> list =(List)bean.getSysModelMap();
    Map<String,UtilBean> itemMap = (Map<String,UtilBean>)list.get(0);
    Set set = itemMap.keySet();
    Iterator it = set.iterator();
    StringBuffer item = new StringBuffer(),indicator = new StringBuffer(),indicators = new StringBuffer(),zIndicator = new StringBuffer("[");
    
    int a=0;
    
    while(it.hasNext()) {
	   String key = (String)it.next();
	   UtilBean b = (UtilBean)itemMap.get(key);
	   
	   //System.out.println("key==========="+key);	   
	   //System.out.println("b==========="+b.getId());
	   
	   if(!key.equals("title")&& !key.equals("ldzcNC")&&!key.equals("yysrNC")&&!key.equals("zczjNC")&&!key.equals("fldzc")&&!key.equals("syzqyhj")){

   	   item.append(b.getId());
           if(a!=itemMap.size()-7){
        	  item.append(",");
           }
        a++;
	   }      
    }
   
   //System.out.println("item====="+item);
   String index = item.toString()+itemMap.get("title").getId()+","+itemMap.get("ldzcNC").getId()+","+itemMap.get("yysrNC").getId()+","+itemMap.get("zczjNC").getId()+","+itemMap.get("fldzc").getId()+","+itemMap.get("syzqyhj").getId();
   //System.out.println("index====="+index);
   
   Map<String,UtilBean> inMap =(Map<String,UtilBean>)list.get(1);
   Set iset = inMap.keySet();
   //System.out.println("iset============"+iset);
   Iterator its = iset.iterator();
   //System.out.println("长度"+iset.size());
   
   a=0;
   
   while(its.hasNext()) {    
	  String key = (String)its.next();
	  UtilBean b = (UtilBean)inMap.get(key);
	  //System.out.println("b1Id==========="+b.getId());
	  
	  
	  if(!key.contains("zzcbzv")&& !key.contains("zzczzv")){
		  
		indicator.append(b.getId());
        if(a!=inMap.size()-3){
      	 indicator.append(",");
       }      
      a++;
     } 
   }
   //System.out.println("indicator==========="+indicator);
   
   Map<String,UtilBean> inMaps =(Map<String,UtilBean>)list.get(1);
   Set isets = inMaps.keySet();
   System.out.println("isets============"+isets);
   Iterator itss = isets.iterator();
   System.out.println("长度"+isets.size());
   
   a=0;
   
   while(itss.hasNext()) {    
	  String key = (String)itss.next();
	  UtilBean b = (UtilBean)inMaps.get(key);
	  System.out.println("bsId==========="+b.getId());
	  
	  
	  if(key.equals("zzcbzv")||key.equals("zzczzv")){
		  
		indicators.append(b.getId());
        if(a!=1){
      	 indicators.append(",");
       }      
      a++;
     } 
   }
   System.out.println("indicators==========="+indicators);
   
   Map<String,UtilBean> zdyMap =(Map<String,UtilBean>)list.get(2);
   Set zMapSet = zdyMap.keySet();
   Iterator zIt = zMapSet.iterator();
   
   a=0;
   
   while(zIt.hasNext()){
   	  String key =(String)zIt.next();
   	  UtilBean b = (UtilBean)zdyMap.get(key);
   	  //System.out.println("key2==========="+key);
      //System.out.println("b2==========="+b);
   	 
   	  
   	  if(!key.equals("10002")&& !key.equals("10003")){
   		 zIndicator.append("{\"id\":\""+key+"\",\"formular\":"+b.getText()+",\"params\":["+b.getId()+"],\"exp\":\""+b.getSql()+"\"}");
   	  if(a!=zdyMap.size()-3){
   		  zIndicator.append(",");
          }
   	  a++;
      }
   }
     zIndicator.append("]"); 
     //System.out.println("zIndicator==========="+zIndicator);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>最新资产结构模型</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<jsp:include page="../../common/jsp/sys.jsp"></jsp:include>
</head>
<style>
input,span {
	border: 0;
	font-weight: bold;
	font-size: 13px;
	width: 120px;
	text-align: right;
	-webkit-border-radius: 45px;
	border-radius: 45px;
	margin-top: -5px;
	margin-left: 16px;
	
}

input:focus {
	background-color: #FF6;
}

.main {
	width: 950px;
	height: 600px;
	margin: 0 auto;
	padding: 10px;
}

div {
	border: #FF0000 solid 0px;
}

.top {
	margin-top: -30px;
	margin-left: 90px;
	height: 50%;
	width: 100%;
}

.top_left {
	height: 100%;
	width: 28%;
	float: left;
}

.top_left1 {
	height: 100%;
	width: 62%;
	float: left;
}

.top_left2 {
	height: 100%;
	width: 30%;
	float: left;
	background: #FFF;
}

 .top_right {
	/*
	height: 100%;
	width: 72%;
	float: left;*/
	float:left;
	margin-left:50px;

}

.top_right1 {
	/*height: 100%;
	width: 47%;
	float: left;8*/
	width:170px;
	float:left;
	

}

div.top_shell {
	height: 55px;
	clear:left;
}

.but {
	margin-left: 20px;
	height: 45%;
	width: 100%;
}

.but_left {
	height: 90%;
	width: 35%;
	float: left;
}

.but_right {
	height: 85%;
	width: 65%;
	float: left;
}

.content {
	width: 100%;
	height: 60px;
	font-family: "微软雅黑";
	font-size: 13px;
}

.widget-header {
	background: url(images/navbg.jpg) 0 bottom repeat-x;
	height: 30px;
	border: 1px solid white;
	overflow: hidden;
	text-align: left;
}

.widget-header strong {
	font: 14px '微软雅黑', '华文中宋';
	line-height: 25px;
	background: url(images/house.png) 10px 2px no-repeat;
	padding: 0 30px;
}

.demo1 {
	background-image: url(images/tu11.jpg);
	float: left;
	height: 150px;
	width: 315px;
	background-position: center center;
	margin: 3px 10px 0px 30px;
	text-align: left;
	font-size: 14px;
	font-family: 微软雅黑;

}

#document {
	margin: 0 auto;
	padding: 0px;
	border: 0px solid #303030;
	margin-top: 25px;
}

.qjxz {
	text-align: center;
	font-family: "微软雅黑";
	font-size: 25px;
	color: #000;
	width: 50%;
	font-weight: bold;
	text-transform: capitalize;
	letter-spacing: 8px;
	text-shadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0
		#b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0, 0, 0, .1), 0 0 5px
		rgba(0, 0, 0, .1), 0 1px 3px rgba(0, 0, 0, .3), 0 3px 5px
		rgba(0, 0, 0, .2), 0 5px 10px rgba(0, 0, 0, .25), 0 10px 10px
		rgba(0, 0, 0, .2), 0 20px 20px rgba(0, 0, 0, .15);
}
--></style>
<body>
 <jsp:include page="../../common/jsp/common.jsp"></jsp:include>
	<div id="mainshell" class="image_divss" style="width:996px;">
	       <!--  <div class="cnbi-date"></div> -->
		<div class="mainshell">资产结构预测模型</div>
		<div class="main" id="doc" style="display: bolck;">
			<div id="document" class="demo" style="height: 650px; width: 100%;">
				<div class="qjxz"></div>
				<div class="top">
					<div class="top_left">
						<div class="top_left1">
							<div class="content">

								<div>
									<label for="<%=itemMap.get("yysr").getId()%>input">营业收入</label>
								</div>
								<div id="<%=itemMap.get("yysr").getId()%>Id"></div>
								<div>
									<input type="text" id="<%=itemMap.get("yysr").getId()%>Idinput" value="50"style="border: 0; color: #f6931f; font-weight: bold; width: 100px" />
								</div>
							</div>
							<div class="content">
								<div>
									<label for="<%=itemMap.get("lrze").getId()%>input">利润总额</label>

								</div>
								<div id="<%=itemMap.get("lrze").getId()%>Id"></div>
								<div>
									<input type="text" id="<%=itemMap.get("lrze").getId()%>Idinput" value="50"
										style="border: 0; color: #f6931f; font-weight: bold; width: 100px"
										/>
								</div>
							</div>
							<div class="content">
								<div>
									<label for="<%=itemMap.get("cwfy").getId()%>input">财务费用</label>

								</div>
								<div id="<%=itemMap.get("cwfy").getId()%>Id"></div>
								<div>
									<input type="text" id="<%=itemMap.get("cwfy").getId()%>Idinput" value="50"style="border: 0; color: #f6931f; font-weight: bold; width: 100px"/>
								</div>
							</div>
							<div class="content">
								<div>
									<label for="<%=itemMap.get("ldzc").getId()%>input">流动资产</label>
								</div>
								<div id="<%=itemMap.get("ldzc").getId()%>Id"></div>
								<div>
									<input type="text" id="<%=itemMap.get("ldzc").getId()%>Idinput" value="50"style="border: 0; color: #f6931f; font-weight: bold; width: 100px"/>
								</div>
							</div>
							<div class="content">
								<div>
									<label for="<%=itemMap.get("zczj").getId()%>input">资产总计</label>

								</div>
								<div id="<%=itemMap.get("zczj").getId()%>Id"></div>
								<div>
									<input type="text" id="<%=itemMap.get("zczj").getId()%>Idinput" value="50"style="border: 0; color: #f6931f; font-weight: bold; width: 100px"
										/>
								</div>
							</div>
							<div class="content">
								<div>
									<label for="<%=itemMap.get("fzzj").getId()%>input">负债总计</label>

								</div>
								<div id="<%=itemMap.get("fzzj").getId()%>Id"></div>
								<div>
									<input type="text" id="<%=itemMap.get("fzzj").getId()%>Idinput" value="50"style="border: 0; color: #f6931f; font-weight: bold; width: 100px"/>
								</div>
							</div>
						</div>
						<div class="top_left2">
							<div style="float: left; margin-top: 17px">
								<img src="images/line5.png" />
							</div>



						</div>
					</div>
					<div class="top_right">
						<div class="top_right1"
							style="font-size: 12px; font-family: '微软雅黑';">
								<div class="top_shell" style="margin-bottom:50px;">

									<div style="margin-top: 20px; margin-left: 0px">
										流动资产增长率</div>
									<div id="<%=inMap.get("ldzczcv").getId()%>Id"
										style="width: 150px; margin-top: 20px; margin-left: 0px"></div>
									<div style="text-align: right; width: 170px">
										<span id="<%=inMap.get("ldzczcv").getId()%>Idspan">194.89%</span>
									</div>
									<div style="clear:both;"></div>
								</div>
								<div class="top_shell" style="margin-top: 0px;margin-bottom:50px;">
									<div style="margin-top: 20px; margin-left: 0px">
										营业收入增长率</div>
									<div id="<%=inMap.get("yysrzcv").getId()%>Id"
										style="width: 130px; margin-top: 20px; margin-left: 0px"></div>
									<div
										style="text-align: right; width: 170px; margin-left: 0px">
										<span id="<%=inMap.get("yysrzcv").getId()%>Idspan">0.00%</span>
									</div>
								</div>
								<div class="top_shell" style="margin-top: 0px;margin-bottom:50px">
									<div style="margin-top: 20px; margin-left: 0px">资产负债率</div>
									<div id="<%=inMap.get("zcfzv").getId()%>Id"
										style="width: 130px; margin-top: 20px; margin-left: 0px"></div>
									<div
										style="text-align: right; width: 170px; margin-left: 0px">
										<span id="<%=inMap.get("zcfzv").getId()%>Idspan">0.00%</span>
									</div>
								</div>
							</div>
						<div class="top_right1"
							style="width: 300px; border: 0px solid red; margin-left: 50px">
							<ul>
								
								<li>
									<div id="<%=inMaps.get("zzcbzv").getId()%>Id"
										style="margin-left: 0px; margin-top: 5px; width: 290px"></div>
								</li>
								<li style="border: 0px solid red; height: 30px">
									<div style="margin-top: 2px; font-family: 微软雅黑; text-align: center; font-weights: bold; font-size: 14px;">
										<strong>总资产报酬率</strong>
									</div>
								</li>
								
								<li>
									<div id="<%=inMaps.get("zzczzv").getId()%>Id" style="margin-top: 5px; margin-left: 0px"></div>
								</li>
								<li style="border: 0px solid red; height: 30px">
									<div style="margin-left: 100px; font-family: 微软雅黑; font-weight: bold; font-size: 14px;">
										<strong>总资产增长率</strong>
									</div>
								</li>

							</ul>
						</div>
					</div>
					<div style="clear:both;"></div>
				</div>
				<div style="clear:both;"></div>
				<div class="but" style="border: 0px solid red">
					<div class="but_left" style="margin-top: 60px; margin-left: 0px">
						<div class="demo1 image_div" style="margin-top: 0px">
							<font
								style="font-size-adjust: inherit; solid red; font-family: 微软雅黑"><br>&nbsp;&nbsp;资产结构状况:<br></font>
							<hr>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
								id="zczkspan">总体来看，流动资产增长慢于主营业务收入增长，并且资产的盈利能力有所提高,资产结构趋于改善!<br></span>
						</div>
						<div id="pietitle"
							style="font-family: 微软雅黑; font-weight: bold; margin-top: -13%; font-size: 14px; margin-left: 170%; width: 85%; border: 0px solid red">资产、负债及权益构成图</div>
						<div class="but_right" id="chartdiv"
							style="margin-top: -50%; margin-left: 120%; width: 85%; border: 0px solid red">


						</div>


					</div>


				</div>



			</div>

			
		</div>
	</div>
	<script type="text/javascript" src="js/industry.js"></script>
	<script type="text/javascript" src="js/zcfy_tsj.js"></script>
<script type="text/javascript">
var bean ={};
		Ext.onReady(function() {
		    var item='<%=item.toString()%>',
			indi='<%=indicator.toString()%>';
			//var slider_array=item.split(",");
			slider_array=["<%=itemMap.get("yysr").getId()%>",
		                  "<%=itemMap.get("lrze").getId()%>",
		                  "<%=itemMap.get("cwfy").getId()%>",
		                  "<%=itemMap.get("ldzc").getId()%>",
		                  "<%=itemMap.get("zczj").getId()%>",
		                  "<%=itemMap.get("fzzj").getId()%>"
						 ];  

		    <%-- industryParams=[{"<%=inMaps.get("zzcbzv").getId()%>":"总资产报酬率(%)"},{"<%=inMaps.get("zzczzv").getId()%>":"总资产增长率(%)"}],str=Utils.getUtilBeanStr(industryParams);   --%>
		    
		    progress_array=["<%=inMap.get("zcfzv").getId()%>",
			                  "<%=inMap.get("ldzczcv").getId()%>",
			                  "<%=inMap.get("yysrzcv").getId()%>"
							 ];  
		    //****************************
		    var params ={itemIndex:"<%=index%>",showDim:'item',povitDim:'item',queryFact:'B',company:company["id"],type:"assets",year :qj.year,month :qj.month,unit :qj.unit,compareYear :qj.yearBj,compareMonth :qj.monthBj};
			var dd = <%=zIndicator.toString()%>;
			
			
			//var params ={company:company["id"], industryParams:str,index:index,query:2,year :qj.year,month :qj.month,unit :qj.unit,compareYear :qj.yearBj,compareMonth :qj.monthBj};
		    bean =  new Cnbi.model.Assets({
		    	 id:'assets',
			     slider_array:slider_array,
			     params:params,
			     progress_array:progress_array,
			     updateInput:'Idinput',
			     //doubleUIFlag:"pro",
			     pro:{width:170},
			     sli:{width:155},
			     //industryParams:str,
			     domArray:["<%=inMaps.get("zzcbzv").getId()%>Id","<%=inMaps.get("zzczzv").getId()%>Id","chartdiv","_cnbi_chartId"], 
			     companyName:company["text"],
			     indi:indi,//从数据库找的公式ID群
			     zIndicator:dd,//自定义公式群 zcfzv 
			     judgeObj:{syzqyhj:"<%=itemMap.get("syzqyhj").getId()%>",
			    	 ldzc:"<%=itemMap.get("ldzc").getId()%>",
			    	 fzzj:"<%=itemMap.get("fzzj").getId()%>",
			    	 fldzc:"<%=itemMap.get("fldzc").getId()%>",
			    	 zcfzv:"<%=inMap.get("zcfzv").getId()%>",
			    	 ldzczcv:"<%=inMap.get("ldzczcv").getId()%>",
			    	 yysrzcv:"<%=inMap.get("yysrzcv").getId()%>",
			    	 zzcbzv:"<%=inMap.get("zzcbzv").getId()%>",
			    	 zzczzv:"<%=inMap.get("zzczzv").getId()%>"}
			       			    
		   });		    		   		  
		});
</script>
</body>
</html>
